package com.example.education.Mapper;

import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.education.Bean.ForeignSubjects;
import com.example.education.Bean.StudentInfo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 姚
 * @since 2023-03-27
 */

@Mapper
public interface ForeignSubjectsMapper extends BaseMapper<ForeignSubjects> {
    //增

    @Insert("INSERT into foreign_subjects (uid,university_Name,subject_Name) values (#{uid},#{universityName},#{subjectName})")
    int insert(ForeignSubjects foreignSubjects);

    //删
    @Delete("delete from foreign_subjects where uid=#{uid}")
    int delete(Integer uid);


    //查相应学校的所有专业
    @Select("select * from foreign_subjects where university_Name=#{universityName}")
    ForeignSubjects[] select(String universityName);


    //改
    int update(ForeignSubjects foreignSubjects, UpdateWrapper<StudentInfo> updateWrapper);
}
